<?php
namespace app\index\logic;

use think\facade\Request;

class IndexLogic{
    //goods留值处理
    public static function   goodData(){
        $param=Request::param();
        $data=[
            'keywords'=>isset($param['keywords'])?$param['keywords']:'',
            'id'=>isset($param['id'])?$param['id']:'',
        ];
        return $data;
    }
    //goods 商品列表条件拼接
    public static function   goodWhere(){
        $where=[];
        $param=Request::param();
        if (isset($param['keywords']) && !empty($param['keywords'])){
            $where[]=['goods_name','like','%'.$param['keywords'].'%'];
        }
        return $where;
    }
}